package com.itheima.test;

public class ArrTest6 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5};
        int temp = 0;
        int flag = 0;
        for (int i = 0; i < arr.length - flag; i++, flag++) {
            temp = arr[i];
            arr[i] = arr[arr.length - 1 - flag];
            arr[arr.length - 1 - flag] = temp;

        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "\t");
        }

    }
}
